package com.wkbb.basic.thread;

import com.wkbb.basic.feign.TcCloudFeignService;
import com.wkbb.basic.mapper.OrganizationMapper;
import com.wkbb.basic.model.Employee;
import com.wkbb.basic.service.ClassInfoService;
import com.wkbb.basic.service.TeacherManageService;
import com.wkbb.common.dto.basic.EmployeeInfoDto;
import lombok.extern.slf4j.Slf4j;

/**
 * @author dengjingyuan
 * @date 2019-11-13 19:05
 */
@Slf4j
public class ImChangeUserTypeTask implements Runnable {
    private TeacherManageService teacherManageService;

    private ClassInfoService classInfoService;

    private TcCloudFeignService tcCloudFeignService;

    private OrganizationMapper organizationMapper;

    private EmployeeInfoDto employeeInfoDto;

    private Employee employee;


    public ImChangeUserTypeTask(ClassInfoService classInfoService, TcCloudFeignService tcCloudFeignService,OrganizationMapper organizationMapper,EmployeeInfoDto employeeInfoDto,Employee employee,TeacherManageService teacherManageService) {
        this.classInfoService = classInfoService;
        this.teacherManageService = teacherManageService;
        this.tcCloudFeignService = tcCloudFeignService;
        this.organizationMapper = organizationMapper;
        this.employeeInfoDto = employeeInfoDto;
        this.employee = employee;
    }

    public ImChangeUserTypeTask() {

    }

    @Override
    public void run() {
        log.info("*********ImChangeUserTypeTask********ImChangeUserTypeTask:{},classInfoService:{},tcCloudFeignService:{},organizationMapper:{},employeeInfoDto:{},employee:{}", classInfoService, tcCloudFeignService,organizationMapper,employeeInfoDto,employee);
        try {
            teacherManageService.changeUserType(employeeInfoDto,employee);
        } catch (Exception e) {
            log.error("*******ImChangeUserTypeTask**********ImChangeUserTypeTask:{},changeUserType:{}", e);
        }
    }
}